package com.bd.scm.domain.dto.department;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yufc
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DeptAgGridTree implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId
    private Long depSerial;

    private Integer depParent;

    private Integer depOrder;

    private String depName;

    private String depNo;

    private String depRule;

    private String depRegserial;

    private String jzDtAbbreviation;

    private Integer depTeachserial;

    private Integer depLx;

    private String depDomain;

    @TableField(value = "id")
    private Integer autoId;

    private String depNoAdd;

    private String depNoParent;

    private String oldDepNo;

    private String treeNode;

    @TableField(exist = false)
    private List<String> filePath;

    @TableField(exist = false)
    private Long id;

    public void setDepSerial(Long depSerial) {
        this.depSerial = depSerial;
        this.id = depSerial;
    }

    public void setTreeNode(String treeNode) {
        this.treeNode = treeNode;
        this.filePath = Arrays.asList(treeNode.split(","));
    }

    private String orgType;

    private String orgCostCenter;

    private String isDelete;
}